<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>自适应相册</title>
  <link rel="stylesheet" href="style.css">
  <link rel="stylesheet" href="https://cdn.bootcss.com/magnific-popup.js/1.1.0/magnific-popup.min.css">
  <script src="https://cdn.bootcss.com/jquery/3.4.0/jquery.min.js"></script>
  <script src="https://cdn.bootcss.com/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js"></script>

</head>
<body>
  <div class="gallery-section">
    <div class="inner-width">
      <h1>我的相册</h1>
      <div class="border"></div>
      <div class="gallery">
        <a href="img/1.jpg" class="image">
          <img src="img/1.jpg" alt="">
        </a>
        <a href="img/2.jpg" class="image">
          <img src="img/2.jpg" alt="">
        </a>
        <a href="img/3.jpg" class="image">
          <img src="img/3.jpg" alt="">
        </a>
        <a href="img/4.jpg" class="image">
          <img src="img/4.jpg" alt="">
        </a>
        <a href="img/5.jpg" class="image">
          <img src="img/5.jpg" alt="">
        </a>
        <a href="img/6.jpg" class="image">
          <img src="img/6.jpg" alt="">
        </a>
        <a href="img/7.jpg" class="image">
          <img src="img/7.jpg" alt="">
        </a>
        <a href="img/8.jpg" class="image">
          <img src="img/8.jpg" alt="">
        </a>
      </div>
    </div>
  </div>
  <script>
    $(".gallery").magnificPopup({
      delegate:'a',
      type:'image',
      gallery:{
        enabled:true
      }
    });
  </script>
</body>
</html>